package com.bqtv.sport.ui.mine

import android.content.Context
import android.content.Intent
import android.view.View
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.StaggeredGridLayoutManager
import com.bqtv.sport.R
import com.bqtv.sport.adapter.MyVipAdapter
import com.bqtv.sport.app.AppActivity
import com.bqtv.sport.commen.widget.LinearItemDecoration
import com.bqtv.sport.databinding.ActivityMyVipBinding

class MyVipActivity : AppActivity<ActivityMyVipBinding>() {
    private lateinit var vipAdapter: MyVipAdapter

    companion object {
        fun start(context: Context) {
            val intent = Intent(context, MyVipActivity::class.java)
            context.startActivity(intent)
        }
    }

    override fun getViewBinding() = ActivityMyVipBinding.inflate(layoutInflater)

    override fun initView() {

        binding.rcvDetail.layoutManager = LinearLayoutManager( this)
        binding.rcvDetail.addItemDecoration(
            LinearItemDecoration(
                getContext(),
                LinearItemDecoration.LineDrawMode.VERTICAL,
                0f,
                10f,
                10f
            )
        )

        vipAdapter = MyVipAdapter()
        binding.rcvDetail.adapter = vipAdapter

    }

    override fun initData() {
        vipAdapter.submitList(listOf("1", "2", "3", "4", "5", "6", "7"))


        initListener()
    }

    private fun initListener() {

    }

    override fun onClick(view: View) {
        super.onClick(view)
        when (view.id) {
            R.id.iv_back -> finish()
        }
    }
}